function error
{
  exit $1
}
NEWLANG=$1

sed "s/SUPPORTED=.*$/SUPPORTED=\"de_DE:de:en_US:en:es_ES:es:fr_FR:fr:hu_HU:hu:ja_JP:ja:it_IT:it:ru_RU:ru:sk_SK:sk\"/" /etc/sysconfig/i18n > /var/hsc/tmp/i18n

if [ $? != 0 ] ; then
  echo "ERROR: Could not create locale in /var/hsc/tmp"
  error $?
fi

cp /var/hsc/tmp/i18n /etc/sysconfig/i18n  2>/dev/null

if [ $? != 0 ] ; then
  echo "ERROR: Could not copy locale file to /etc/sysconfig"
  error $?
fi

rm /var/hsc/tmp/i18n 2>/dev/null

if [ $? != 0 ] ; then
  echo "ERROR: Could not remove /var/hsc/tmp/i18n"
fi

exit 0
